<template>
  <div>
    <component :is="currentHeader" />
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import { mapGetters } from 'vuex'
import FullContent from '@/components/admin/header/fullContent.vue'
import CommonHeader from '@/components/admin/header/index.vue'
import { ActionsType as SystemActionsType } from '@/actions/system'

export default Vue.extend({
  components: {
    FullContent,
    CommonHeader,
  },
  layout: 'client-only',
  middleware: ['adminAuth'],
  data() {
    return {
      collapsed: false,
    }
  },

  computed: {
    ...mapGetters('user', ['showMoreApp']),
    currentHeader() {
      if (this.showMoreApp) {
        return 'FullContent'
      } else {
        return 'CommonHeader'
      }
    },
  },

  mounted() {
    // this.$store.dispatch(ActionsType.setBaseInfo)
    this.$store.dispatch(SystemActionsType.getDepartments)
    this.$store.dispatch(SystemActionsType.getRoles)
  },
})
</script>
<style lang="scss" scoped></style>
